﻿@{
    ViewBag.Title = "NoneActiveSong";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
    List<ListenMusic.AdminSong_ServiceReference.SongSinger> lst_songSinger = ViewBag.lstsongSinger;
}
<script type="text/javascript">
    function activeSong(songid) {
        var res = window.confirm('Cho phép bài hát này được đăng tải lên hệ thống?');
        if (res) {
            $.ajax({
                url: '/managesong/activeSong',
                data: { 'songid': songid },
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (result) {
                    location.reload();
                }
            });
        } else {return false;}
    }
    function deleteSong(songid) {
        var res = window.confirm('Bạn chắc chắn xoá bài hát này ra khỏi hệ thống!');
        if (res) {
            $.ajax({
                url: '/managesong/deleteSong',
                data: { 'songid': songid },
                contentType: 'application/json; charset=utf-8',
                dataType: "json",
                success: function (result) {
                    location.reload();
                }
            });
        } 
        else {
        return false;
        }
    }
    function updateSong(songid) {
        location = '/managesong/updatesongpage?songid=' + songid;
    }
</script>
    	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="../../Images/AdminImages/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="../../Images/AdminImages/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
			
				<!--  start message-yellow -->
			@*	<div id="message-yellow">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="yellow-left">You have a new message. <a href="">Go to Inbox.</a></td>
					<td class="yellow-right"><a class="close-yellow"><img src="../../Images/AdminImages/table/icon_close_yellow.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<!--  end message-yellow -->
				
				<!--  start message-red -->
				<div id="message-red">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="red-left">Error. <a href="">Please try again.</a></td>
					<td class="red-right"><a class="close-red"><img src="../../Images/AdminImages/table/icon_close_red.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<!--  end message-red -->
				
				<!--  start message-blue -->
				<div id="message-blue">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="blue-left">Welcome back. <a href="">View my account.</a> </td>
					<td class="blue-right"><a class="close-blue"><img src="../../Images/AdminImages/table/icon_close_blue.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>
				<!--  end message-blue -->
			
				<!--  start message-green -->
				<div id="message-green">
				<table border="0" width="100%" cellpadding="0" cellspacing="0">
				<tr>
					<td class="green-left">Product added sucessfully. <a href="">Add new one.</a></td>
					<td class="green-right"><a class="close-green"><img src="../../Images/AdminImages/table/icon_close_green.gif"   alt="" /></a></td>
				</tr>
				</table>
				</div>*@
				<!--  end message-green -->
		
		 
				<!--  start product-table ..................................................................................... -->
                 <div id="step-holder">
                    <div class="step-no">+</div>
			        <div class="step-dark-left"><a href="/managesong/NoneActiveSong?pageindex=1">Kiểm duyệt</a></div>
			        <div class="step-dark-right">&nbsp;</div>
			        <div class="step-no-off">+</div>
			        <div class="step-light-left"><a href="/managesong/viewallsong?pageindex=1">Xem tất cả</a></div>
			        <div class="step-light-right">&nbsp;</div>
			        <div class="step-no-off">+</div>
			        <div class="step-light-left"><a href="/managesong/uploadSong">Upload bài hát mới</a></div>
			        <div class="step-light-right">&nbsp;</div>			
			        <div class="clear"></div>
		        </div>
				<form id="mainform" action="">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><a id="toggle-all" ></a> </th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Tên bài hát</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Thể loại</a></th>
					<th class="table-header-repeat line-left"><a href="">Ca sĩ</a></th>
					<th class="table-header-repeat line-left"><a href="">Nhạc sĩ</a></th>
					<th class="table-header-repeat line-left"><a href="">Thành viên</a></th>
					<th class="table-header-options line-left"><a href="">Tuỳ chọn</a></th>
				</tr>
                    @if (lst_songSinger.Count < 1)
                    {
                        <tr>
                        <td colspan="7" style="text-align:center"><h3>Không có bài hát nào đang chờ kiểm duyệt.</h3></td>
                        </tr>
                    }
                    else
                    {
                        for (int i = 0; i < lst_songSinger.Count; i++)
                        {
                            if (i % 2 == 0)
                            {                 
                        <tr>
					        <td><input type="checkbox"/></td>
					        <td>@lst_songSinger[i].SongName</td>
					        <td>@lst_songSinger[i].CategoryName</td>
					        <td><a href="">@lst_songSinger[i].SingerName</a></td>
					        <td>@lst_songSinger[i].MusicianName</td>
					        <td><a href="">@lst_songSinger[i].UserName</a></td>
					        <td class="options-width">	
                            <a href="javascript:updateSong(@lst_songSinger[i].SongID)" title="Cập nhật" class="icon-1 info-tooltip"></a>					                                   				       
					        <a href="javascript:deleteSong(@lst_songSinger[i].SongID)" title="Xoá" class="icon-2 info-tooltip"></a>					       
					        <a href="javascript:activeSong(@lst_songSinger[i].SongID)" title="Active" class="icon-5 info-tooltip"></a>
					        </td>
				        </tr>
                            }
                            else
                            { 
                            <tr class="alternate-row">
					        <td><input type="checkbox"/></td>
					        <td>@lst_songSinger[i].SongName</td>
					        <td>@lst_songSinger[i].CategoryName</td>
					        <td><a href="">@lst_songSinger[i].SingerName</a></td>
					        <td>@lst_songSinger[i].MusicianName</td>
					        <td><a href="">@lst_songSinger[i].UserName</a></td>
					        <td class="options-width">	
                            <a href="javascript:updateSong(@lst_songSinger[i].SongID)" title="Cập nhật" class="icon-1 info-tooltip"></a>					       				       
					        <a href="javascript:deleteSong(@lst_songSinger[i].SongID)" title="Xoá" class="icon-2 info-tooltip"></a>					       
					        <a href="javascript:activeSong(@lst_songSinger[i].SongID)" title="Active" class="icon-5 info-tooltip"></a>
					        </td>
				        </tr>
                            }
                        }
                    }
				</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			<!--  end content-table  -->
		
			<!--  start actions-box ............................................... -->
			<div id="actions-box">
				<a href="" class="action-slider"></a>
				<div id="actions-box-slider">
					<a href="" class="action-edit">Edit</a>
					<a href="" class="action-delete">Delete</a>
				</div>
				<div class="clear"></div>
			</div>
			<!-- end actions-box........... -->
			
			<!--  start paging..................................................... -->
			<table border="0" cellpadding="0" cellspacing="0" id="paging-table">
			<tr>
			<td>
				 @{
                    ViewBag.next =  ViewBag.pageindex + 1;
                    if(ViewBag.pageindex >= ViewBag.totalSong)
                    {
                        ViewBag.next = ViewBag.totalSong;
                    }
                    ViewBag.pre = ViewBag.pageindex - 1;
                    }
				<a href="/managesong/NoneActiveSong?pageindex=1" title="Về trang đầu" class="page-far-left"></a>
				<a href="" class="page-left"></a>
				<div id="page-info">Trang <strong>@ViewBag.pageindex</strong> / @ViewBag.totalSong</div>
				<a href="/managesong/NoneActiveSong?pageindex=@ViewBag.next" class="page-right"></a>
				<a href="/managesong/NoneActiveSong?pageindex=@ViewBag.totalSong" title="Đến trang cuối" class="page-far-right"></a>
			</td>
			<td>
			<select  class="styledselect_pages" onchange="location = this.options[this.selectedIndex].value">
                <option>Đi nhanh</option>
                 @for (int k = 1; k <= ViewBag.totalSong; k++)
                    {  
                     <option value="/managesong/NoneActiveSong?pageindex=@k">@k</option>
                    }				
			</select>
			</td>
			</tr>
			</table>
			<!--  end paging................ -->
			<div class="clear"></div>
		 
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id="tbl-border-right"></td>
	</tr>
	<tr>
		<th class="sized bottomleft"></th>
		<td id="tbl-border-bottom">&nbsp;</td>
		<th class="sized bottomright"></th>
	</tr>
	</table>
	<div class="clear">&nbsp;</div>
<div class="clear">&nbsp;</div>

    @*<div id="content">
    
    <div id="content-song">
        @if (lst_songSinger.Count < 1)
        { 
            <h3>Hôm nay không có thành viên nào upload bài hát mới.</h3>
        }
        else
        {
            <h3>Hôm nay có @ViewBag.countSong bài hát được upload.</h3>
        <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
            <tr class="titletable"><td></td><td>Tên bài hát</td><td>Thể loại</td><td>Ca sĩ</td><td>Nhạc sĩ</td><td>Thành viên</td></tr>
            @foreach (ListenMusic.AdminSong_ServiceReference.SongSinger ss in lst_songSinger)
            { 
                <tr>
                    <td><a id="activeSong" href="javascript:activeSong(@ss.SongID)">Active</a></td>
                    <td>@ss.SongName</td>
                    <td>@ss.CategoryName</td>
                    <td>@ss.SingerName</td>
                    <td>@ss.MusicianName</td>     
                    <td>@ss.UserName</td>               
                </tr>
            }
        </table>
            <div class="pagenumber">
           <label>Trang:</label>
                @for (int k = 1; k <= ViewBag.totalSong; k++)
                { 
                    <a href="/managesong/NoneActiveSong?pageindex=@k">@k</a>
                }
            </div>
        }
    </div>
</div>
*@
@**@